﻿using System;
using System.Linq;
using System.Web;
using System.Web.Http;
using Microsoft.Practices.ObjectBuilder2;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.IoC;

namespace Sharp.Services.CMS
{
    public class Global : HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            //
            Container.ConfigureContainer();
            GlobalConfiguration.Configure(WebApiConfig.Register);

            var bootstraps = ServiceLocator.Instance.GetServiceAll<IBootstrapPlugin>().ToArray();
            bootstraps.ForEach(x =>
            {
                x.Initialize();
            });
            
        }
    }
}